package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.example.pojo.Ipfs;

import java.util.List;

public interface IpfsMapper {

    /**
     * 查询数据
     * @return
     */
    @Select("select * from ipfs")
    @ResultMap("brandResultMap")
    List<Ipfs> query();

    /**
     * 插入数据
     * @return
     */
    @Insert("insert into ipfs values (null,#{name},#{hashCode})")
    void add(Ipfs ipfs);

    /**
     * 根据删除
     * @return
     */
    @Delete("delete from ipfs where name = #{name};")
    void delete(String name);
}
